package com.ithema.notebook.notify;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationDisplayType;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.Notifications;
import com.intellij.openapi.ui.MessageType;

/**
 * Package: com.ithema.notebook.notify
 * Description：系统消息
 * @author: huangjian
 * Date:  2020/10/19 11:14
 * Modified By:
 */
public class SystemNotify {

    public static void notify(NotifyType notifyType){
        NotificationGroup notificationGroup = new NotificationGroup(notifyType.getCode(), NotificationDisplayType.BALLOON, true);
        Notification click = notificationGroup.createNotification(notifyType.getMessage(), MessageType.INFO);
        Notifications.Bus.notify(click);
    }

    public static void notify(NotifyType notifyType,String extMsg){
        NotificationGroup notificationGroup = new NotificationGroup(notifyType.getCode(), NotificationDisplayType.BALLOON, true);
        Notification click = notificationGroup.createNotification(String.format(notifyType.getMessage(),extMsg), MessageType.INFO);
        Notifications.Bus.notify(click);
    }
}
